using System;

static class ExtensionArray
{
    public static T[] Resize<T>(this T[] self, int length)
    {
        #if ! CF
        Array.Resize(ref self, length);
        #else
        var aux = new T[length];
        Array.Copy(self, aux, self.Length);
        self = aux;
        #endif

        return self;
    }

    public static bool IsNullOrEmpty<T>(this T[] self)
    {
        return self == null || self.Length == 0;
    }
}
